package com.zm.feign.api;

import com.zm.entity.User;
import com.zm.feign.Imp.UserServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "user",path = "/user",fallback = UserServiceImpl.class)//调用user服务 路径是controller路径 fallback本地降级使用的类
public interface UserService {

    @PostMapping("/addUser")//传输数据方式用post接受的数据需要用RequestBody注解
    public Boolean addUser(@RequestBody User user);

    @GetMapping("/getUserList")//传输数据方式用get,一般不用接收数据，不用添加注解
    public List<User> getUserList();


}
